<template>
	<view class="content">
		<TopHead :title="'项目核销'"></TopHead>
		<view class="conbox">



		</view>
		<view class="btnbox">
			<view class="btn" @click="scanCode"><uni-icons class="icon-scan" type="scan" color="#fff"
					size="20"></uni-icons> 项目核销</view>
		</view>
	</view>
</template>

<script>
	import TopHead from '../../components/topHead/topHead.vue';
	export default {
		components: {
			TopHead
		},
		data() {
			return {
				certificateId: '',
				newuser: '', // 
				userDataInfo: {}, // 
				page: 1,
				pageSize: 10,
				list: [],
				total: 0, //

			}
		},
		onLoad() {

		},
		onShow() {

		},
		onReachBottom() {
			// 触底分页
			console.log('触底')
			// if (this.total > this.list.length) {
			// 	this.page = parseInt(this.page) + 1
			// }
		},
		methods: {
			// 扫码
			scanCode() {
				let _this = this;
				uni.scanCode({
					// onlyFromCamera: true, // 只允许通过相机扫码
					scanType: ['barCode', 'qrCode'], // barCode条形码  qrCode二维码
					success: function(res) {
						console.log(res)
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						_this.handData(res.result)
					}
				});
			},
			// 
			handData(e) {
				let _this = this;
				let user_info = uni.getStorageSync('user_info')
				user_info = JSON.parse(user_info)
				_this.$http.fetchData({
					url: '/wechatApplet/worker/check/' + e + '/' + user_info.id,
					method: 'POSt',
					data: {},
					success(res) {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});

					}
				})
			},



		}
	}
</script>

<style scoped>
	.content {
		height: 100%;
		box-sizing: border-box;
		overflow-y: auto;
	}

	.conbox {
		padding: 30rpx;
		padding-top: 196rpx;
	}

	.btnbox {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		padding: 30rpx;
		background-color: #fff;
		box-shadow: 0 2rpx 10rpx 0rpx rgba(93,69,41,0.25);  
		z-index: 9;
	}

	.btnbox .btn {
		height: 80rpx;
		background-color: #e47917;
		border-radius: 10rpx;
		text-align: center;
		line-height: 80rpx;
		color: #fff;
		font-size: 28rpx;
	}

	.btnbox .btn .icon-scan {
		vertical-align: middle;
		margin-right: 20rpx;
	}
</style>